<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<jsp:directive.page import="com.anhry.app.safety.util.Util"/>
<%@ include file="/WEB-INF/pages/share/taglib.jsp"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>企业添加</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="<%=basePath+Util.SKIN%>/css/right.css" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="<%=basePath%>/js/jquery-1.7.2.js"></script>
	<script type="text/javascript" src="<%=basePath%>/js/check_jquery.js"></script>
	<script type="text/javascript" src="<%=basePath%>/js/addfj.js"></script>
	<script type="text/javascript" src="<%=path%>/js/My97DatePicker/WdatePicker.js" defer="defer"></script><base target="_self" />
	<script type="text/javascript">
		$(document).ready(function(){
			$("#addMoredoc").click(function(){//附件添加
				addFj('moredoc','docFile');
			});
			
			var dw1='${yh.yhDw1}';
			var dw2='${yh.yhDw2}';
			var dw3='${yh.yhDw3}';
			var dw4='${yh.yhDw4}';
			var dw5='${yh.yhDw5}';
		    if(dw1==1){document.getElementById("yhDwDate1").style.display='inline';}
		    if(dw2==1){document.getElementById("yhDwDate2").style.display='inline';}
		    if(dw3==1){document.getElementById("yhDwDate3").style.display='inline';}
		    if(dw4==1){document.getElementById("yhDwDate4").style.display='inline';}
		    if(dw5==1){document.getElementById("yhDwDate5").style.display='inline';}
		});
	  	function fnSearch(){
	  		var api = frameElement.api, W = api.opener;
		  	W.zcForm.submit();
      	}
      	function doRadio(id,v){
      		if(v==0){
      			document.getElementById('yhDwDate'+id).style.display='none';
      		}else{
      			document.getElementById('yhDwDate'+id).style.display='inline';
      		}
      	}
      	function doSave(m){
      		document.getElementById('isSubmit').value=m;
      		if(m==1){
      			document.form1.submit();
      		}
      	}
      	function deleFj(id,vname){
			var vids=vname+id;
			$.ajax({
				type:"POST",
				url:"<%=basePath%>/zczb/big_deleFj.action?fjId="+id,
				success:function(data){
					if(data=="1"){
						document.getElementById(vids).style.display="none";
					}else{
						alert('删除失败！');
					}		  			
			    }
			});				
		}
	</script>
	<style>
		* html body {padding:0px 0px 6px 0px;}
	</style>
  </head>
  
  <body>
	<div  class="body-box">
		<div id="container">
			<form action="<%=basePath%>/zczb/big_yhZgSave.action" method="post" name="form1" enctype="multipart/form-data">
		    	<table border="0" cellspacing="0" cellpadding="0"  width="100%" class="info_table">
					<tr>
						<td colspan="2">填写隐患整改信息，隐患整改完成后点击提交，提交后就不能再修改信息。</td>
					</tr>
					<tr>
						<td class="title_td">整改责任人：</td>
						<td><input type="text" name="yhZgPer" value="${yh.yhZgPer }" id="bit1" size="50%"><span class="note4">*</span></td>
					</tr>
					<tr>
						<td class="title_td">整改期限：</td>
						<td><input type="text" name="yhZgTime" type="text" id="yhZgTime" value="<s:date name="yh.yhZgTime" format="yyyy-MM-dd"/>" readonly="readonly"/></td>
					</tr>
					<tr>
						<td class="title_td">整改资金：</td>
						<td><input type="text" name="yhZgZj" value="${yh.yhZgZj }" id="bnumber1"><span class="note4">*</span>（单位为元）</td>
					</tr>
					<tr>
						<td colspan="2">以下为五到位信息，选择“是”后填写到位落实时间。</td>
					</tr>
					<tr>
						<td class="title_td">整改责任是否到位：</td>
						<td>
							<s:radio list="#{0:'否',1:'是' }" name="yhDw1" value="%{yh.yhDw1==null?'0':yh.yhDw1}" theme="simple" onclick="doRadio('1',this.value)"></s:radio>
							<input type="text" name="yhDwDate1" type="text" id="yhDwDate1" value="<s:date name="yh.yhDwDate1" format="yyyy-MM-dd"/>" class="Wdate" onclick="WdatePicker({readOnly:true,maxDate:'%y-%M-%d'});" style="display: none"/>
						</td>
					</tr>
					<tr>
						<td class="title_td">整改措施是否到位：</td>
						<td>
							<s:radio list="#{0:'否',1:'是' }" name="yhDw2" value="%{yh.yhDw2==null?'0':yh.yhDw2}" theme="simple" onclick="doRadio('2',this.value)"></s:radio>
							<input type="text" name="yhDwDate2" type="text" id="yhDwDate2" value="<s:date name="yh.yhDwDate2" format="yyyy-MM-dd"/>" class="Wdate" onclick="WdatePicker({readOnly:true,maxDate:'%y-%M-%d'});" style="display: none"/>
						</td>
					</tr>
					<tr>
						<td class="title_td">整改资金是否到位：</td>
						<td>
							<s:radio list="#{0:'否',1:'是' }" name="yhDw3" value="%{yh.yhDw3==null?'0':yh.yhDw3}" theme="simple" onclick="doRadio('3',this.value)"></s:radio>
							<input type="text" name="yhDwDate3" type="text" id="yhDwDate3" value="<s:date name="yh.yhDwDate3" format="yyyy-MM-dd"/>" class="Wdate" onclick="WdatePicker({readOnly:true,maxDate:'%y-%M-%d'});" style="display: none"/>
						</td>
					</tr>
					<tr>
						<td class="title_td">整改时限是否到位：</td>
						<td>
							<s:radio list="#{0:'否',1:'是' }" name="yhDw4" value="%{yh.yhDw4==null?'0':yh.yhDw4}" theme="simple" onclick="doRadio('4',this.value)"></s:radio>
							<input type="text" name="yhDwDate4" type="text" id="yhDwDate4" value="<s:date name="yh.yhDwDate4" format="yyyy-MM-dd"/>" class="Wdate" onclick="WdatePicker({readOnly:true,maxDate:'%y-%M-%d'});" style="display: none"/>
						</td>
					</tr>
					<tr>
						<td class="title_td">应急预案是否到位：</td>
						<td>
							<s:radio list="#{0:'否',1:'是' }" name="yhDw5" value="%{yh.yhDw5==null?'0':yh.yhDw5}" theme="simple" onclick="doRadio('5',this.value)"></s:radio>
							<input type="text" name="yhDwDate5" type="text" id="yhDwDate5" value="<s:date name="yh.yhDwDate5" format="yyyy-MM-dd"/>" class="Wdate" onclick="WdatePicker({readOnly:true,maxDate:'%y-%M-%d'});" style="display: none"/>
						</td>
					</tr>
					<tr>
						<td class="title_td">整改完成日期：</td>
						<td><input type="text" name="yhWcDate" type="text" id="byear1" value="" class="Wdate" onclick="WdatePicker({readOnly:true,maxDate:'%y-%M-%d'});"/><span class="note4">*</span></td>
					</tr>
					<tr>
						<td class="title_td">隐患整改措施：</td>
						<td id="moredoc">
							<input type="button" name="fj2" value="添加附件" id="addMoredoc" class="link_input"/>
							<s:if test="%{fjList1.size>0}">
								<br/>
								<s:iterator id="fj" value="fjList1">
									<span id="docfj_${fj.id}">
										<a href="<%=filePath%>/${fj.fjPath }" target="_blank">${fj.fjTitle }</a>
										<a href="javascript:deleFj('${fj.id}','docfj_')" title="删除"><img src="<%=basePath%>/images/deletex.gif"/></a>
									</span>
								</s:iterator>
							</s:if>
						</td>
					</tr>
					<tr>
						<td align="center" colspan="2">
							<center>
							<input type="button" name="btntj1" class="link_input" id="btn1" value="保 存" onclick="doSave('1')">
							<input type="submit" name="btntj2" class="link_input" id="btnSubmit1" value="提 交" onclick="doSave('2')">
							</center>
						</td>
					</tr>
			  	</table>
				<input type="hidden" name="yhId" value="${yhId }">
				<input type="hidden" name="auditType" value="${auditType }">
				<input type="hidden" name="isSubmit" value="" id="isSubmit">
			</form>
		</div>
	</div>
  </body>
  <s:if test="%{tip!=null}">
	<script>
		alert('${tip}');
		fnSearch();
	</script>
  </s:if>
</html>
